<template>
    <div>
        <span>子组件user：{{user}}</span><br/>
        <button @click="addAge">子组件-用户年龄+1</button><br/>
        <span>子组件msg:{{msg}}</span><br/>
        <button @click="changeMsg">子组件-修改msg</button><br/>
    </div>
</template>

<script>
    export default {
        name: "son",
        props:['user','msg'],
        methods:{
            addAge(){
                this.user.age++;
            },
            changeMsg(){
                this.msg = '张三子';
            }
        }
    }
</script>

<style scoped>

</style>
